package com.moloon.game.sanguo.editor.propseditor.view.mission;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.SectionPart;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.ModifyEvent;

public class MissionBaseSection extends SectionPart {

	private Text text_2;
	private Text text_1;
	private Text text;
	/**
	 * Create the SectionPart
	 * @param parent
	 * @param toolkit
	 * @param style
	 */
	public MissionBaseSection(Composite parent, FormToolkit toolkit, int style) {
		super(parent, toolkit, style);
		createClient(getSection(), toolkit);
	}

	/**
	 * Fill the section
	 */
	private void createClient(Section section, FormToolkit toolkit) {
		section.setText("基本信息");
		Composite container = toolkit.createComposite(section);
		final GridLayout gridLayout = new GridLayout();
		gridLayout.numColumns = 2;
		container.setLayout(gridLayout);
		//
		section.setClient(container);

		final Label label_2 = toolkit.createLabel(container, "ID:", SWT.NONE);
		label_2.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));

		text = toolkit.createText(container, null, SWT.NONE);
		text.addModifyListener(new ModifyListener() {
			public void modifyText(ModifyEvent e) {
			}
		});
		text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		final Label label_1 = toolkit.createLabel(container, "任务名称:", SWT.NONE);
		label_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));

		text_1 = toolkit.createText(container, null, SWT.NONE);
		text_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		final Label label = toolkit.createLabel(container, "任务描述:", SWT.NONE);
		label.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));

		text_2 = toolkit.createText(container, null, SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
		text_2.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
	}

}
